/*
 * Топологическая сортировка
 */
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include <string.h>

#define N_MAX 100000
#define M_MAX 100000

#define DFS_TREE	(1 << 4)
#define DFS_NOT_TREE	(1 << 5)
#define DFS_TSORT_OK	5141
#define	DFS_TSORT_FAIL	2342
#define COLOR_WHITE	0
#define COLOR_GRAY	1
#define COLOR_BLACK	2

struct Node {
	int x;
	Node *next;
};

struct adjlist {
	Node *first;
	Node *last;
	int8_t size;

	/* Other attributes */
	int8_t		color;
	int8_t		visited;
	int		distance;
	int		conn_sp_id;
};


static int list[N_MAX];
static int list_idx = N_MAX; //points to the first (meaningful) record

static void
pushback(struct adjlist *al, int x)
{
	Node *newnode;

	newnode = (Node *) calloc(1UL, sizeof (Node));
	newnode->x = x;
	newnode->next = NULL;
	if (!al->first)
		al->first = newnode;
	else
		al->last->next = newnode;
	al->last = newnode;
	al->size++;
}

static void
free_al(struct adjlist *al)
{
	struct Node *n, *p;
	p = n = al->first;
	while (n) {
		n = n->next;
		free(p);
		p = n;
	}
}

/* unneeded {{{
static int
dfs_chk_connection(struct adjlist * const al, const int start)
{
	Node *node = NULL;

	al[start].visited = 1;
	node = al[start].first;

	while (node) {
		if (!al[node->x].visited)
			dfs_chk_connection(al, node->x);
		node = node->next;
	}

	return (0);
}
*/

/*
static int
dfs_chk_cycles(struct adjlist * const al, const int start, const int sender,
		const int distance)
{
	int ret = 0;
	Node *nd = NULL;

	if (al[start].color == COLOR_GRAY)
		return (DFS_NOT_TREE);

	al[start].color   = COLOR_GRAY;
	nd                = al[start].first;

	while (nd) {
		if (nd->x == sender || al[nd->x].distance != distance - 1)
			goto cont;
		ret = dfs_chk_cycles(al, nd->x, start, distance + 1);
		if (ret == DFS_NOT_TREE)
			return (DFS_NOT_TREE);
		*//* if (ret == DFS_TREE) goto cont; *//*
cont:
		nd = nd->next;
	}

	al[start].color = COLOR_BLACK;

	return (DFS_TREE);
}
}}} */

static int
dfs_topo_sort(struct adjlist * const al, const int start)
{
	Node *nd = NULL;
	int ret = 0;

	al[start].visited = 1;
	//al[start].conn_sp_id = conn_sp_id;
	al[start].color = COLOR_GRAY;
	nd = al[start].first;

	while (nd) {
		if (al[nd->x].color == COLOR_WHITE) {
			if ((ret = dfs_topo_sort(al, nd->x)) == DFS_TSORT_FAIL)
				return (DFS_TSORT_FAIL);
		} else if (al[nd->x].color == COLOR_GRAY) { //found a cycle
			return (DFS_TSORT_FAIL); //нужно конденсировать граф
		}
		nd = nd->next;
	}

	list[--list_idx] = start;
	al[start].color = COLOR_BLACK;

	return (DFS_TSORT_OK);
}

inline void
print_topo_sort_list(void)
{
	register int i;
	for (i = list_idx; i < N_MAX; i++)
		(void) printf("%d ", list[i] + 1);
	(void) putc('\n', stdout);
}

int
main(void)
{
	struct adjlist	*AL;
	static char	line[1024];
	int		n, m;
	register int	i, a, b;
	int		ans;

	(void) fgets(line, sizeof line, stdin);
	(void) sscanf(line, "%d %d", &n, &m);

	AL = (struct adjlist *) calloc(n, sizeof (struct adjlist));

	for (i = 0; i < m; ++i) {
		(void) fgets(line, sizeof line, stdin);
		(void) sscanf(line, "%d %d", &a, &b);
		a--; b--;
		pushback(AL + a, b);
	}

	for (i = 0; i < n; i++) {
		AL[i].color = COLOR_WHITE;
		AL[i].visited = AL[i].distance = 0;
	}

	for (i = 0; i < n; i++) {
		if (AL[i].color == COLOR_WHITE)
			if ((ans = dfs_topo_sort(AL, i)) == DFS_TSORT_FAIL) {
				puts("-1");
				goto cleanup;
			}
	}

out:
	print_topo_sort_list();
cleanup:
	for (i = 0; i < n; i++)
		free_al(&AL[i]);
	free(AL);
	return (0);
}
// vim:set foldmethod=marker:
